﻿# MIT License

file(GLOB myRtspSer_SRC_LIST ./*.cpp ./*.h)

set(COMPILE_DEFINITIONS ${MK_COMPILE_DEFINITIONS})
set(ExeFileN myRtspSer)

find_package(CURL REQUIRED)

if(CURL_FOUND) 
  include_directories(${CURL_INCLUDE_DIR})
  message(STATUS "Curl Include: ${CURL_INCLUDE_DIR}")
  message(STATUS "Curl Found: ${CURL_VERSION_STRING} ${CURL_LIBRARIES} ${CURL_LINK_LIBRARIES}")
else()
  message(FATAL_ERROR "Could not find the CURL library and development files.")
endif()


include_directories(/usr/local/include/cpr/)
find_library(CPR_LIBRARY NAMES cpr PATHS /usr/local/lib)
if(CPR_LIBRARY)
  message(STATUS "CPR library :${CPR_LIBRARY}")
else()
  message(FATAL_ERROR "CPR library not found!")
endif()

add_executable(${ExeFileN} ${myRtspSer_SRC_LIST})
target_compile_definitions(${ExeFileN} PRIVATE ${COMPILE_DEFINITIONS})
target_compile_options(${ExeFileN} PRIVATE ${COMPILE_OPTIONS_DEFAULT})
# libcurl
target_link_libraries(${ExeFileN} ${CURL_LIBRARIES}) 
# cpr
target_link_libraries(${ExeFileN} ${CPR_LIBRARY})

target_link_libraries(${ExeFileN} -Wl,--start-group ${MK_LINK_LIBRARIES} -Wl,--end-group)
